<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection"content="telephone=no, email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" /><!-- 删除苹果默认的工具栏和菜单栏 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" /><!-- 设置苹果工具栏颜色 -->
    <meta name="renderer" content="ie-comp">
    <meta name="renderer" content="ie-stand">
    <meta name="renderer" content="webkit"> 
    <meta name="keywords" content="耀盛中国,耀盛智投,理财产品,智选财富,耀盛智投官网"/>
    <meta name="description" content="耀盛智投为耀盛中国旗下理财产品智选平台。专注于为大众富裕阶层、精英个人、中产阶级家庭、合规机构等提供定制化资产配置咨询推荐服务，帮助客户实现财富的增值。" />
    <title>交易记录</title>
    <script src="../../lib/js/ftSize.js"></script>
    <link rel="stylesheet" href="../../lib/css/_base.css">
    <link rel="stylesheet" type="text/css" href="../../lib/css/personageset.css">
    <link rel="stylesheet" href="../../lib/css/minirefresh.min.css">
</head>
<body>
    <h1 class="rem90R"><img src="../../lib/images/left.png" class="leftImg" onClick="prevAttectation()">交易记录</h1>
    <div id="minirefresh" class="minirefresh-wrap" style="padding-top: .9rem;">
        <div class="minirefresh-scroll">
            <div class="jy_list" id="transactMain"></div>
        </div>
    </div>
    <!-- <div class="jy_list" id="transactMain">
        <h5 class="padding35">2018年2月</h5>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
    </div> -->
   <!--  <div class="jy_list ">
        <h5 class="padding35">2017年12月</h5>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
        <div class="jy_particulars">
            <div class="transaction_xq">
                <div class="transaction_l">
                    <h2>提现</h2>
                    <p>2018-09-02 22:00:00</p>
                </div>
                <div class="transaction_r">
                    <h2>333.00元</h2>
                    <p>可用余额 298元</p>
                </div>
            </div>
        </div>
    </div> -->
    <div class="common_myriad" id="transactRecord" style="display:none">
        <img src="../../lib/images/myriad.png">
        <p>暂无记录</p>
    </div>
<script src="../../lib/js/jquery.min.js"></script>    
<script src="../../lib/js/public-header.js"></script> 
<script type="text/javascript" src="../../lib/js/minirefresh.min.js"></script>
<script>
 /* $(function () {
        // 初始化页码
        var page = 0;
        // miniRefresh 对象
        var miniRefresh = new MiniRefresh({
            container: '#minirefresh',
            down: {
                isLock: true,//是否禁用下拉刷新
                callback: function () {
                    doAjax('down');
                }
            },
            up: {
                isAuto: true,
                callback: function () {
                     doAjax('up');
                }
            }
        });
        function tansactJson(page,pagesize) {
                let wpuserToken = window.sessionStorage.getItem("wpuserToken");//tiken
                var json = {
                    "faceCode":"my/trades",
                    "token":wpuserToken,
                    "clientInfo":"W,100,IE8",
                    "requestTime": "2018-07-03 18:12:04",
                    "body":{
                        "pageNow":page,
                        "pageSize":pagesize
                    }
                }
                return json;
            }

        var doAjax = function (downOrUp) {
            if (downOrUp == 'down') {
                page = 1;// 下拉刷新页码设置
            } else {
                page++;// 上拉加载递增页码
            }
            var pagesize = 10;
            $.ajax({  
                type: "POST",
                url: httpServer+"my/trades",
                headers:{
                    'Access-Control-Allow-Origin':'*'
                }, 
                async:false,
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify(tansactJson(page,pagesize)),
                dataType: "json",
                success: function (data) {  
                    if(data.resCode!='0'){
                        
                    }else{
                        var arrLen = data.body.orderList.length;
                        if (arrLen > 0) {
                           
                            var html = '';
                            $.each(data.body.orderList, function (key, value) {
                                html +=`<div class="jy_particulars"><div class="transaction_xq"><div class="transaction_l"><h2>`+value.tradeType+`</h2><p>`+value.tradeDateS+`</p></div><div class="transaction_r"><h2>`+value.tradeAmount+`元</h2><p>可用余额 `+value.availableAmount+`元</p></div></div></div>`
                            });
                            setTimeout(function () { // 使用 setTimeout 函数是方便演示的，你可以不用 setTimeout 函数
                                if (downOrUp == 'down') {
                                    $('#transactMain').html('');
                                    $('#transactMain').append(html);// DOM 插入数据
                                    miniRefresh.endDownLoading(true);// 结束下拉刷新
                                } else {
                                   
                                    $('#transactMain').append(html);
                                    if (data.body.totalPage == page) {// 是否已取完数据页
                                        miniRefresh.endUpLoading(true);// 结束上拉加载
                                    } else {
                                        miniRefresh.endUpLoading(false);
                                    }
                                }
                            }, 600);
                        } else {
                            $(".upwrap-tips").show(30000).delay(2000).fadeOut(2000);
                            $('#transactRecord').show();
                            if (downOrUp == 'down') {
                                $('#transactMain').html('');
                                miniRefresh.endDownLoading(true);
                            } else {
                                miniRefresh.endUpLoading(true);
                            }
                        }
                    }
                },
                error: function(error){  
                    console.log(error,1);  
                }    
            }); 
        };
    });
 */
</script>
<script>
    $(function () {
        //我的保险
        function tansactJson(page,pagesize) {
            let wpuserToken = window.sessionStorage.getItem("wpuserToken");//tiken
            var json = {
                "faceCode":"my/trades",
                "token":wpuserToken,
                "clientInfo":"W,100,IE8",
                "requestTime": "2018-07-03 18:12:04",
                "body":{
                    "pageNow":page,
                    "pageSize":pagesize
                }
            }
            return json;
        }
        // 初始化页码
        var page = 0; var html = ''; var pagesize = 10;
        // miniRefresh 对象
        var miniRefresh = new MiniRefresh({
            container: '#minirefresh',
            down: {
                isLock: true,//是否禁用下拉刷新
                callback: function () {}
            },
            up: {
                isAuto: true,
                callback: function () {
                    page++;// 上拉加载递增页码
                    $.ajax({  
                        type: "POST",
                        url: httpServer+"my/trades",
                        headers:{
                            'Access-Control-Allow-Origin':'*'
                        }, 
                        async:false,
                        contentType: "application/json; charset=utf-8",
                        data: JSON.stringify(tansactJson(page,pagesize)),
                        dataType: "json",
                        success: function (data) {  

                            if(data.resCode!='0'){
                                twoError(data)
                            }else{
                                var arrLen = data.body.orderList.length;
                                if (arrLen > 0) {
                                   
                                    $('#transactRecord').css('display','none')
                                    $.each(data.body.orderList, function (key, value) {
                                        html +=`<div class="jy_particulars"><div class="transaction_xq"><div class="transaction_l"><h2>${value.tradeType}</h2><p>${value.tradeDateS}</p></div><div class="transaction_r"><h2>${value.tradeAmount}元</h2><p>可用余额 ${value.availableAmount}元</p></div></div></div>`
                                    });
                                    setTimeout(function () { // 使用 setTimeout 函数是方便演示的，你可以不用 setTimeout 函数
                                            $('#transactMain').html(html);
                                           // $('#transactMain').append(html);
                                            if (data.body.totalPage == page) {// 是否已取完数据页
                                                miniRefresh.endUpLoading(true);// 结束上拉加载
                                            } else {
                                                miniRefresh.endUpLoading(false);
                                            }
                                        
                                    }, 600);
                                    if(data.body.totleRows!='0'){
                                        $('.upwrap-tips').css('display','inline-block')
                                    }
                                } else {
                                    if(data.body.totleRows!='0'){
                                        $('.upwrap-tips').css('display','inline-block')
                                    }else{
                                        $('#transactMain').html(`<div class="common_myriad" id="transactRecord"><img src="../../lib/images/myriad.png"><p>暂无记录</p></div>`)
                                        $('.upwrap-tips').css('display','none')
                                    }
                                        miniRefresh.endUpLoading(true);
                                    
                                }
                            }
                        },
                        error: function(error){  
                            console.log(error,1);  
                        }    
                    }); 
                }
            }
        });
    });
    </script> 
</body>
</html>